package jp.tkym.labs.m3d;

import java.util.ArrayList;
import java.util.List;


/**
 * 
 * @author kazunari
 *
 */
public class ModelingPoint3D extends AbstractModelingPoint3D{
	List<Model3D> objectList = new ArrayList<Model3D>();
	
	public ModelingPoint3D add(Model3D object){
		objectList.add(object);
		return this;
	}
	
	public ModelingPoint3D remove(Model3D object){
		objectList.remove(object);
		return this;
	}
	
	ModelingPoint3D(String name){
		super(name);
	}
	
	public ModelingPoint3D add(float x, float y, float z){
		coordinateModel.coordinate.px += x;
		coordinateModel.coordinate.py += y;
		coordinateModel.coordinate.pz += z;
		return this;
	}
	
	public ModelingPoint3D moveOnX(float x){
		return this.add(x, 0.0f, 0.0f);
	}
	
	public ModelingPoint3D moveOnY(float y){
		return this.add(0.0f, y, 0.0f);
	}
	
	public ModelingPoint3D moveOnZ(float z){
		return this.add(0.0f, 0.0f, z);
	}
	
	public ModelingPoint3D rotate(float alpha, float beta, float gamma){
		coordinateModel.coordinate.alpha += alpha;
		coordinateModel.coordinate.beta  += beta;
		coordinateModel.coordinate.gamma += gamma;
		return this;
	}
	
	public ModelingPoint3D rotateAlpha(float alpha){
		return this.rotate(alpha, 0.0f, 0.0f);
	}
	
	public ModelingPoint3D rotateBeta(float beta){
		return this.rotate(0.0f, beta, 0.0f);
	}
	
	public ModelingPoint3D rotateGamma(float gamma){
		return this.rotate(0.0f, 0.0f, gamma);
	}
	
	public Camera3D camera(DeviceTranslator device, ProjectionTranslator projection){
		return new Camera3D(this, device, projection);
	}
}